import os
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from time import sleep

driver = webdriver.Chrome()

driver.set_window_size(700, 1000)
driver.maximize_window()
# driver.get("file:///C:/Users/S3214/Downloads/uploadfile.html")
# input标签上传文件
# driver.find_element_by_id("file").send_keys(r"C:\Users\S3214\Desktop\pagetest\img")
# sleep(2)
# 非input标签上传文件
# driver.get("file:///C:/Users/S3214/Downloads/uploadfile.html")
# driver.get("file:///C:/Users/S3214/Desktop/Auit.html")
# driver.find_element_by_tag_name("label").click()
# os.system(r"C:\Users\S3214\Documents\新建文件夹\autoit.exe")
# os.system(r"C:\Users\S3214\Documents\新建文件夹\auit.exe") # 上传图片文件

driver.get("https://www.baidu.com/")
driver.find_element_by_class_name("soutu-btn").click()
sleep(2)
driver.find_element_by_tag_name("input").click()
os.system(r"C:\Users\S3214\Documents\新建文件夹\wyh.exe")
#driver.find_element_by_class_name("soutu-btn").click()

WebDriverWait(driver, 60)
sleep(2)
driver.quit()
